package com.xiaoshuidi.cloud.module.rooms.pojo.roomel;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.xiaoshuidi.cloud.framework.jackson.core.databind.LocalDateTimeSerializer;
import com.xiaoshuidi.cloud.module.rooms.framework.utils.EsIdSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.zxp.esclientrhl.annotation.ESID;
import org.zxp.esclientrhl.annotation.ESMapping;
import org.zxp.esclientrhl.annotation.ESMetaData;
import org.zxp.esclientrhl.enums.Analyzer;
import org.zxp.esclientrhl.enums.DataType;

import java.time.LocalDateTime;

/**
 * @Author: lss
 * @CreateTime: 2023-04-21 18:19
 * @Version: 1.0
 */
@Schema(description = "es房间索引结构")
@ESMetaData(indexName = "fy_roomel",printLog = true )
@Data
public class RoomelEntity {
    //房间编码
    @ESID
    @JsonSerialize(using = EsIdSerializer.class)
    @Schema(description = "房间编码")
    private Long id;

    @ESMapping(datatype = DataType.text_type, analyzer = Analyzer.ik_max_word, search_analyzer = Analyzer.ik_smart)
    @Schema(description = "房间全名")
    private String fullName;

    //房间name
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "房间name")
    private String roomHouseName;

    //房间编号
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "房间编号")
    private String roomHouseNo;

    //室号
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "室号")
    private String houseNo;

    //核验码
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "核验码")
    private String checkCode;

    //核验码有效期
    @ESMapping(datatype = DataType.date_type)
    @Schema(description = "核验码有效期")
    private LocalDateTime checkCodeInDate;

    //房间的上级id（分散房源使用，集中房源为空）
    @ESMapping(datatype = DataType.long_type)
    @Schema(description = "房间的上级id（分散房源使用，集中房源为空）")
    private Long superId;

    //小区编码
    @ESMapping(datatype = DataType.long_type)
    @Schema(description = "小区编码")
    private Long apartmentAreaId;

    //街道
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "街道")
    private String street;

    //空间编号
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "空间编号")
    private String spaceNo;

    //小区名称
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "小区名称")
    private String apartmentAreaName;

    //公寓名称
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "公寓名称")
    private String apartmentName;

    //公寓id
    @ESMapping(datatype = DataType.long_type)
    @Schema(description = "公寓id")
    private Long apartmentId;

    //集中式判定
    @ESMapping(datatype = DataType.boolean_type)
    @Schema(description = "集中式判定")
    private Boolean isConcentrated;

    //小区经纬度 lat+,+lon
    @ESMapping(datatype = DataType.geo_point_type)
    @Schema(description = "小区经纬度 lat+,+lon")
    private String apartmentAreaGeo;
    //门店经纬度
    @ESMapping(datatype = DataType.geo_point_type)
    @Schema(description = "门店经纬度")
    private String apartmentGeo;

    //房源类型（参数： 市场租赁、品牌公寓、人才公寓）(逗号分割key,value)
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "房源类型（参数： 市场租赁、品牌公寓、人才公寓）(逗号分割key,value)")
    private String sourceType;

    //公寓楼层id
    @ESMapping(datatype = DataType.long_type)
    @Schema(description = "公寓楼层id")
    private Long floorId;

    //楼栋号
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "楼栋号")
    private String buildingNo;

    //单元号
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "单元号")
    private String unitNo;

    //当前楼层
    @ESMapping(datatype = DataType.integer_type)
    @Schema(description = "当前楼层")
    private Integer floorNo;

    //总楼层
    @ESMapping(datatype = DataType.integer_type)
    @Schema(description = "总楼层")
    private Integer floorSum;

    //城市
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "城市")
    private String city;

    //区域
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "区域")
    private String district;


    //地址
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "地址")
    private String address;

    //小区名称
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "小区名称")
    private String residence;

    //房屋户型-室
    @ESMapping(datatype = DataType.integer_type)
    @Schema(description = "房屋户型-室")
    private Integer bedroomNum;

    //房屋户型-厅
    @ESMapping(datatype = DataType.integer_type)
    @Schema(description = "房屋户型-厅")
    private Integer livingroomNum;

    //房屋户型-厨
    @ESMapping(datatype = DataType.integer_type)
    @Schema(description = "房屋户型-厨")
    private Integer kitchenNum;

    //房屋户型-卫
    @ESMapping(datatype = DataType.integer_type)
    @Schema(description = "房屋户型-卫")
    private Integer toiletNum;

    //户型阳台
    @ESMapping(datatype = DataType.integer_type)
    @Schema(description = "户型阳台")
    private Integer balcony;

    //户型ID
    @ESMapping(datatype = DataType.long_type)
    @Schema(description = "户型ID")
    private Long roomHouseTypeId;

    //户型名称
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "户型名称")
    private String roomHouseTypeName;

    //房型ID
    @ESMapping(datatype = DataType.long_type)
    @Schema(description = "房型ID")
    private Long layoutId;

    //房型名称
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "房型名称")
    private String layoutName;

    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "朝向")
    private String facetoType;

    //承租人姓名 暂未用到
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "承租人姓名 暂未用到")
    private String tenantMainName;

    //租客和同住人信息
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "租客和同住人信息")
    private String tenantinfo;

    //是否整租
    @ESMapping(datatype = DataType.boolean_type)
    @Schema(description = "是否整租")
    private Boolean isWhole;

    //是否净房
    @ESMapping(datatype = DataType.boolean_type)
    @Schema(description = "是否净房")
    private Boolean isClean;

    @ESMapping(datatype = DataType.boolean_type)
    @Schema(description = "是否维修房")
    private Boolean isRepair;

    //面积
    @ESMapping(datatype = DataType.double_type)
    @Schema(description = "面积")
    private Double space;

    //价格
    @ESMapping(datatype = DataType.double_type)
    @Schema(description = "价格")
    private Double price;

    //装修情况(0, u'毛坯'),(1, u'普通装修'),(2, u'精装修'),(3, u'豪华装修'),
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "装修情况(0, u'毛坯'),(1, u'普通装修'),(2, u'精装修'),(3, u'豪华装修'),")
    private String decoration;

    //房态(空房、已预定、待入住、入住中、冻结、维修房)
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "房态(空房、已预定、待入住、入住中、冻结、维修房)")
    private String houseState;

    // 是否已预定
    @ESMapping(datatype = DataType.boolean_type)
    @Schema(description = "是否已预定")
    private Boolean isScheduled;


    //合同信息的json
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "合同信息的json")
    private String contractInfo;

    //账单信息的json
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "账单信息的json")
    private String billInfo;

    //预定信息的json
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "预定信息的json")
    private String preInfo;

    //租户id
    @ESMapping(datatype = DataType.long_type)
    @Schema(description = "租户id")
    private Long tenantId;

    //是否锁定
    @ESMapping(datatype = DataType.boolean_type)
    @Schema(description = "是否锁定")
    private Boolean isLock;

    @ESMapping(datatype = DataType.boolean_type)
    @Schema(description = "是否停用")
    private Boolean isStop;

    //公共设施
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "公共设施")
    private String publicFacilities;

    //部门id
    @ESMapping(datatype = DataType.long_type)
    @Schema(description = "部门ID")
    private Long deptId;

    // 房间类型
    @ESMapping(datatype = DataType.keyword_type)
    @Schema(description = "房间类型")
    private String roomType;

    @ESMapping(datatype = DataType.long_type)
    @Schema(description = "小区ID")
    private Long roomAreaId;

    @ESMapping(datatype = DataType.date_type)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = "uuuu-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    // 朝向
    @ESMapping(datatype = DataType.text_type)
    @Schema(description = "朝向")
    private String toward;

    @Schema(description = "房源类型(用途): 办公室、住房")
    private String roomUsage;
    //合同信息的json
//    @ESMapping(datatype = DataType.nested_type,nested_class = ContractinfoEntity.class)
//    private ContractinfoEntity contractinfo;


}
